const makeProxy = require('../lib')

const options = {
    defaultHandler: (call)=>console.log(JSON.stringify(call)),
    methods: {
        getContext: {
            handler: (call)=>console.log(JSON.stringify(call)),
            returnProxy: true
        }
    }
}

const canvasProxy = makeProxy(options)

const ctx = canvasProxy.getContext('2d')

ctx.fillStyle = 'red'
ctx.fillRect(0, 0, 100, 100)
ctx.beginPath();
ctx.moveTo(50, 140);
ctx.lineTo(150, 60);
ctx.lineTo(250, 140);
ctx.closePath();
ctx.stroke();